{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=1229
  Verdict: Accepted
}
var n,i,k,min,j,u,uu,cur,t:longint; a,res,d:array[1..101] of integer; b:array[0..101,0..101] of longint;
begin
assign(input,'input.txt');
assign(output,'output.txt');
reset(input);
rewrite(output);
readln(n);
for i:=1 to n do readln(a[i]);
for i:=1 to n do
    for j:=1 to n do fillchar(b[i],sizeof(b[i]),0);
k:=1;
for i:=1 to n do begin
    if a[i]>100 then inc(k);
    for j:=1 to k do begin
        if (b[i-1][j]+a[i]>b[i-1][j+1]) and (b[i-1][j+1]<>0) then b[i][j]:=b[i-1][j+1] else b[i][j]:=b[i-1][j]+a[i];
        if (j=k) and (a[i]>100) then b[i][j]:=b[i-1][j-1]+a[i];
        if (a[i]>100) and (j<>1) then begin
           if b[i][j]>b[i-1][j-1]+a[i] then b[i][j]:=b[i-1][j-1]+a[i];
        end;
    end;
end;
min:=b[n][1];
for i:=2 to k do if (b[n][i]<min) and (b[n][i]<>0) then min:=b[n][i];
writeln(min);
fillchar(res,sizeof(res),0);
fillchar(d,sizeof(d),0);
cur:=min;
u:=0;
uu:=0;
for i:=n downto 1 do begin
    t:=0;
    for j:=1 to k do if b[i][j]=cur then t:=j;
    if i=n then uu:=t-1;
    if (a[i]>100) and (b[i-1][t-1]=cur-a[i]) then dec(cur,a[i]) else
    if (b[i-1][t]=cur-a[i]) then dec(cur,a[i]) else
    if (b[i-1][t+1]=cur) then begin
       inc(u);
       d[u]:=i;
    end;
end;
writeln(uu,' ',u);
for i:=u downto 1 do writeln(d[i]);
end.